<template>
  <div class="parkingmain">
    <el-empty description="加载中..." v-if="empty"></el-empty>
    <div class="parkinginfo" v-for="item in userParkingInfo" :key="item.pid">
      <el-row :gutter="0">
        <el-col :span="24"
          ><div
            class="grid-content"
            style="font-weight: 700;
              font-size: 18px;
              border-bottom: 1px dashed #000;
            "
          >
            车位所有权信息
          </div></el-col
        >
        
        <el-col :span="8"
          ><div class="grid-content">
            车位编号：<span>{{ 1 }}</span>
          </div></el-col
        >
        <el-col :span="8"
          ><div class="grid-content">
            车位归属人编号：<span>{{ item.uid }}</span>
          </div></el-col
        >
      </el-row>
      <el-row :gutter="0">
        <el-col :span="24"
          ><div
            class="grid-content"
            style="font-weight: 700;
              font-size: 18px;
              border-bottom: 1px dashed #000;
            "
          >
            车位信息
          </div></el-col
        >
        <el-col :span="8"
          ><div class="grid-content">
            车位编号：<span>{{ item.pid }}</span>
          </div></el-col
        >
        <el-col :span="8"
          ><div class="grid-content">
            车位所在小区编号：<span>{{ item.vid }}</span>
          </div></el-col
        >
        <el-col :span="8"
          ><div class="grid-content">
            车位标价：<span>{{ item.price }}￥</span>
          </div></el-col
        >
      </el-row>
      <el-row :gutter="0">
        <!-- <el-col :span="8"
          ><div class="grid-content">
            车位号：<span>{{ item.pid }}</span>
          </div></el-col
        > -->

        <!-- <el-col :span="8"
          ><div class="grid-content">
            车位状态：<span>{{ parkingStatus(item.park.status) }}</span>
          </div></el-col
        > -->
        <el-col :span="8"
          ><div class="grid-content">
            备注：<span>{{ item.remarks }}</span>
          </div></el-col
        >
      </el-row>
    </div>
    
  </div>
</template>

<script>
export default {
  data() {
    return {
      userParkingInfo: [],
      empty:true,
    };
  },
  mounted() {
    this.getAllParking();
  },
  methods: {
    getAllParking() {
      this.$http
        .get(this.baseURL + "/parking/findByUID", {
          params: {
            id: JSON.parse(sessionStorage.getItem("userinfo")).uid,
          },
        })
        .then((res) => {
          this.userParkingInfo = res.data.data;
          this.empty = false;
        });
    },
    parkingStatus(status) {
      if (status == 1) {
        return "车位在售";
      } else if (status == -1) {
        return "车位已售出";
      } else if (status == 0) {
        return "车位已预定";
      } else {
        return "未知";
      }
    },
  },
};
</script>

<style lang="less" scope>
.parkingmain {
  padding: 0 50px;
  .parkinginfo {
    border: 2px solid #bbb;
    box-shadow: 3px 3px 9px #999;
    border-radius: 15px;
    padding: 10px 35px;
    margin-bottom: 15px;
  }
}

.el-row {
  margin-bottom: 10px;
  &:last-child {
    margin-bottom: 0;
  }
}
.el-col {
  border-radius: 4px;
}

.grid-content {
  height: 40px;
  line-height: 40px;
  font-weight: 500;
  padding-left: 10px;
}
// .el-button {
//   padding: 12px 0;
// }
</style>